<%-- 
    Document   : add_prestasi
    Created on : Jan 15, 2014, 3:51:43 AM
    Author     : Muhammad Dony
--%>

<%@include file="../header_user.jsp" %>
        <ul class="nav nav-tabs">
            <li><a href="./identitas">Prestasi</a></li>
            <li><a href="./pendidikan">Riwayat Pendidikan</a></li>
            <li><a href="./organisasi">Riwayat Organisasi</a></li>
            <li><a href="./panitia">Riwayat Kepanitian</a></li>
            <li><a href="./prestasi">Prestasi</a></li>
            <li><a href="./keahlian">Keahlian</a></li>
        </ul>
<%@page import="java.util.List"%>
<%@page import="data.PrestasiData"%>
<%
    PrestasiData dataPrestasi = (PrestasiData) request.getAttribute("dataPrestasi");
    String action = (String) request.getAttribute("buttonName");
%>
        <div class="col-lg-10">
            <div class="row">
                <div class="col-lg-3 col-lg-offset-6 well margin-atas">
                    <form class="form-horizontal col-lg-12 text-center" action="prestasi" role="form" method="POST" parsley-validate>
                        <div class="form-group">
                            <h2>Riwayat Prestasi</h2>
                            <div class="controls">
                                <input class="form-control" type="hidden" name="no" parsley-trigger="change" value="<% if(action.equals("Edit")){ out.print(dataPrestasi.getNomor()); }%>" />
                                <input class="form-control" type="hidden" name="status" parsley-trigger="change" value="<%if(action.equals("Edit")){ out.print(dataPrestasi.getStatus()); } else { out.print("0"); }  %>" />
                            </div>
                            <div class="controls">
                                <label>ID</label>
                                <input class="form-control" type="text" placeholder="Username" name="ID" parsley-trigger="change" value="<%=user.getID()%>" readonly />
                            </div>
                        </div>
                            <div class="form-group">
                            <div class="controls">KategoriPretasi Yang Di Raih</label>
                                <select name="kategori" id="status" class="form-control">  
                                    <option value="1" <% if(action.equals("Edit") && "1".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Akademik </option>
                                    <option value="2" <% if(action.equals("Edit") && "2".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Non Akademik </option>
                                    </select>
                                
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="controls">
                                <label>Pretasi Yang Di Raih</label>
                                <select name="prestasi" id="status" class="form-control">  
                                    <option value="Juara 1" <% if(action.equals("Edit") && "Juara 1".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Juara 1 </option>
                                    <option value="Juara 2" <% if(action.equals("Edit") && "Juara 2".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Juara 2 </option>
                                    <option value="Juara 3" <% if(action.equals("Edit") && "Juara 3".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Juara 3 </option>
                                    <option value="Harapan" <% if(action.equals("Edit") && "Harapan".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Harapan </option>
                                    <option value="Favorit" <% if(action.equals("Edit") && "Favorit".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Favorit </option>
                                    <option value="Finalis" <% if(action.equals("Edit") && "Finalis".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Finalis </option>
                                    <option value="Peserta" <% if(action.equals("Edit") && "Peserta".equals(dataPrestasi.getStatus())){out.print("selected");} %>> Peserta </option>
                                    </select>
                                
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="controls">
                                <label>Kegiatan</label>
                                <input class="form-control" type="text" name="kegiatan" placeholder="Prestasi" value="<% if(action.equals("Edit")){ out.print(dataPrestasi.getPrestasi()); }%>">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="controls">
                                <label>Tingkat Kegiatan</label>
                                <select name="tingkat" id="tingkat" class="form-control">  
                                    <option value="Internasional" <% if(action.equals("Edit") && "Internasional".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> Internasional </option>
                                    <option value="ASEAN" <% if(action.equals("Edit") && "ASEAN".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> ASEAN </option>
                                    <option value="Nasional" <% if(action.equals("Edit") && "Nasional".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> Nasional </option>
                                    <option value="Provinsi" <% if(action.equals("Edit") && "Provinsi".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> Provinsi </option>
                                    <option value="Kota/Kabupaten" <% if(action.equals("Edit") && "Kota/Kabupaten".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> Kota/Kabupaten </option>
                                    <option value="Institut/Universitas" <% if(action.equals("Edit") && "Institut/Universitas".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> Institut/Universitas </option>
                                    <option value="Fakultas" <% if(action.equals("Edit") && "Fakultas".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> Fakultas </option>
                                     <option value="Jurusan" <% if(action.equals("Edit") && "Jurusan".equals(dataPrestasi.getTingkat())){out.print("selected");} %>> Jurusan </option>
                                    </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="controls">
                                <label>Tahun Kegiatan</label>
                                <select name="tahun" id="tahun" class="form-control">
                                <% for(int t = 1990; t<=2015; t++){
                                    String a = String.valueOf(t);
                                 %>   
                                 <option value=<%=a%> <% if(action.equals("Edit") && a.equals(dataPrestasi.getTahun())){out.print("selected");} %>> <%=a%> </option>
                                <%}%>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="controls">
                                <input type="submit" class="btn btn-primary form-control" name="action" value="<%=action%>">
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
<%@include file="../footer_user.jsp" %>